﻿@model DataAccessLayer.Task
<h2>Details </h2>
<p class="details">Task name : @Model.Name</p>
<p class="details">Project name : @Model.ProjectName</p>
<p class="details">Status : @Model.Status</p>
<p class="details">Assign to : @Model.AssignedTo.FirstName @Model.AssignedTo.LastName (@Model.AssignedTo.Role)</p>
<p class="details">Created : @Model.DateTask</p>
<br/>
<h2>Description</h2><br/>
@if (Model.Description == "")
{
    <p style="color: dimgray; text-align: center">There is no description content</p>
}
<p class="details">@Model.Description</p>
<br/>
<h2>Attachments</h2>
@if (!Model.Attachments.Any())
{
    <p style="color: dimgray; text-align: center">There are no attachments</p>
}
else
{
   foreach (var attachment in Model.Attachments)
   {
       <p>@attachment</p>
   }
}
<br/>
<h2>Comments</h2>
@if (Model.Comments.Count==0)
{
    <p style="color: dimgray; text-align: center">There are no comments</p>
}
else
{
    foreach (var comment in Model.Comments)
    {
        <div class="div_comments">
            <p>@comment.Author.FullName() added a comment - @comment.PostDateTime</p>     
            <p>@comment.Body</p>
        </div>
    }
}
<div id="commentForm" >
    <textarea id="comment" placeholder="Type your comment here..."></textarea>
  <br />
  <input type="button" class="button" value="Add comment" onclick="AddComment(@Model.Id)"/>
</div>




